package com.example.mvvmtemplate.base.viewmodel;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

import com.example.mvvmtemplate.base.BaseActivity;

public abstract class BaseMVVMActivity<T extends ViewModel> extends BaseActivity {

    public T viewModel;

    public abstract Class<T> getViewModelClass();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        viewModel = new ViewModelProvider(this).get(getViewModelClass());
    }

}
